using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_FloatNotice : UIBaseNode
    {

        #region Template Generate,don't modify
        protected partial class UIB_UIN_FloatNotice
        {
            #region ObjectBinding Generate 
            public IQIGame.Onigao.Framework.ExText info { protected set; get; }
            public virtual void InitBinding(ObjectBinding __binding)
            {
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("info", out var __tbv0);
                this.info = __tbv0;
            }

            #endregion ObjectBinding Generate 
        }
        #endregion Template Generate,don't modify


        protected UIB_UIN_FloatNotice ui { get; set; }

        private Vector2 v2Add = new Vector2(0, 0);

        protected override void BeforeInit()
        {
            ui = new UIB_UIN_FloatNotice();
            ui.InitBinding(this.csObjBind);
        }

        protected override void OnInit()
        {

        }

        protected override void OnShow()
        {

        }

        protected override void OnHide()
        {
            v2Add.y = 0;
            this.transform.anchoredPosition = v2Add;
        }

        public void Show(string data)
        {
            this.Show();
            this.ui.info.text = data;
        }

        public void OnUpdate()
        {
            v2Add.y = APIUIConst.AddYUpFLoatNotice;
            this.transform.anchoredPosition += v2Add;
        }

        protected override void OnDispose()
        {

        }
    }
}
